#include "HerzeleidPrecompiled.hxx"
#include "HerzeleidShaderSwapSet.hxx"
using namespace HerzeleidRendererShadingNamespaceImpl;

PipelineShaderSwapSet::PipelineShaderSwapSet()
{
	ClearAll();
}

Void PipelineShaderSwapSet::ReleaseAll()
{
	for ( auto &ElementRef : SamplerStateArray ) Safe_Release(ElementRef); 
	for ( auto &ElementRef : ConstantBufferArray ) Safe_Release(ElementRef); 
	for ( auto &ElementRef : ShaderResourceViewArray ) Safe_Release(ElementRef); 
}

Void PipelineShaderSwapSet::ClearAll()
{
	Standard::ZeroValueArray( SamplerStateArray, HERZELEID_SAMPLER_NUM_SLOTS );
	Standard::ZeroValueArray( ConstantBufferArray, HERZELEID_CBUFFER_NUM_SLOTS );
	Standard::ZeroValueArray( ShaderResourceViewArray, HERZELEID_SRV_NUM_SLOTS );
}

ComputeShaderSwapSet::ComputeShaderSwapSet() : 
	PipelineShaderSwapSet()
{
	ClearAll();
}

Void ComputeShaderSwapSet::ReleaseAll()
{
	for ( auto &ElementRef : UnorderedAccessViewArray ) Safe_Release(ElementRef); 
	PipelineShaderSwapSet::ReleaseAll();
}

Void ComputeShaderSwapSet::ClearAll()
{
	Standard::ZeroValueArray( UnorderedAccessViewInitialCountArray, HERZELEID_UAV_NUM_SLOTS );
	Standard::ZeroValueArray( UnorderedAccessViewArray, HERZELEID_UAV_NUM_SLOTS );
	PipelineShaderSwapSet::ClearAll();
}








